const Path = require("path")

const baseConfig = {
    entry: "./bin/Exports.js",
    output: {
        filename: "browser_bundle.js",
        path: Path.resolve(__dirname, "bin"),
        library: "dream_rpc_node_websocket",
        libraryTarget: "umd"
    },
    mode: "production",
    module: {
        rules: [
            {
                test: /\.js$/,
                use: "babel-loader"
            }
        ]
    },
    externals: [
        "dream_rpc"
    ]
}

module.exports = [
    {
        ...baseConfig,
        output: {
            ...baseConfig.output,
            filename: "dream_rpc.websocket_bridge_host.production.js"
        }
    },
    {
        ...baseConfig,
        output: {
            ...baseConfig.output,
            filename: "dream_rpc.websocket_bridge_host.development.js"
        },
        mode: "development"
    }
]